﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucSearchResult.ascx.cs"
    Inherits="ExpertMIS.Forums.UserControl.ucSearchResult" %>
<style type="text/css">
    .result-question
    {
        width: 700px;
    }
    .result-answer
    {
        width: 700px;
        height: auto;
    }
    .result-paging
    {
        text-align: center;
        height: 30px;
        line-height: 28px;
        vertical-align: top;
    }
    .result-paging a
    {
        text-decoration: none;
    }
    .result-paging a:hover
    {
        text-decoration: underline;
    }
    .pagin-btn
    {
        font-size: 9pt;
        border: #595959 1px solid;
        background-color: White;
        color: Black;
    }
    .paged-btn
    {
        font-size: 9pt;
        border: #595959 1px solid;
        background-color: #FFFF00;
        color: #CC3300;
    }
    .tab-questions
    {
        border-left: 1px #1f8bd4 solid;
        font-size: 14px;
        height:30px;
    }
    .tab-questions td
    {
        border-right: 1px #1f8bd4 solid;
        height: 28px;
    }
    .td-choosed
    {
        width: 98px;
        text-align: center;
        background-color: #208cd4;
        padding: 1px;
        color: White;
        font-weight: bold;
        cursor: default;
    }
    .td-unchoosed
    {
        width: 98px;
        text-align: center;
        background-color: White;
        color: #1c7fc0;
        font-weight: bold;
        cursor: pointer;
    }
</style>

<script type="text/javascript">
    function doExpend(obj) {
        var expend = $(obj).attr("expend") == 1;
        var qoid = $(obj).attr("qoid");

        if (expend) {
            $(obj).attr("expend", 0);
            $(".result-answer[qoid='" + qoid + "']").fadeOut(200);
            $(obj).html("+");
        }
        else {
            $(obj).attr("expend", 1);
            $(".result-answer[qoid='" + qoid + "']").fadeIn();
            $(obj).html("-");
        }
    }    
</script>

<asp:DataList runat="server" ID="dlResults" OnItemDataBound="dlResults_ItemDataBound"
    Width="100%" Style="height: 490px; overflow: scroll;">
    <ItemTemplate>
        <div class="result-question">
            <asp:Label runat="server" ID="lblPrefix"></asp:Label>
            <asp:HyperLink runat="server" ID="hlQuestion" Target="_blank"></asp:HyperLink>
        </div>
        <% if (ShowAnswer)
           {%>
        <div class="result-answer" qoid='<%# Eval("F_OID") %>' style="text-align: left; padding-left: 10px;">
            <asp:Label runat="server" ID="lblLastAnswer"></asp:Label>
        </div>
        <%}
        %>
    </ItemTemplate>
    <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" />
    <FooterTemplate>
        <asp:Panel runat="server" ID="pnFoo">
        </asp:Panel>
    </FooterTemplate>
</asp:DataList>
<div class="result-paging">
    <table>
        <tr>
            <td>
                <a href="?start=1">【首 页】</a>
            </td>
            <td>
                <a href="?start=<%= GetPriorPageIndex() %>">【上一页】</a>
            </td>
            <td>
                <a href="?start=<%= GetNextPageIndex() %>">【下一页】</a>
            </td>
            <td>
                <a href="?start=<%= GetLastPageIndex() %>">【尾 页】</a>
            </td>
            <td>
                【页次
                <%= GetPageIndex() %>
                】
            </td>
            <td>
                【共
                <%= GetRecordCount() %>
                条】
            </td>
            <td style="vertical-align: middle;">
                <input id="jumpPage" type="text" style="width: 20px; border: #cccccc 1px solid;"
                    onkeypress="return doKeyPress(event);" />
                <input type="button" value="go" style="width: 28px; height: 20px; border: blakc 1px solid;"
                    onclick="jumpTo();" />
            </td>
        </tr>
    </table>
</div>
